<template>
    <button class="btn btn-sm btn-danger ml-2" @click="handleDelete" >删除</button>
</template>
<script>
    import { ref } from 'vue';
    import { deleteResource } from '@/api/';
    export default {
        props:{
            activeId:Number
        },
        emits:['deleteData'],
        setup(props,context) {
            const handleDelete=async ()=>{
               const res=await deleteResource(props.activeId)
               context.emit("deleteData", res);
            }
            return {handleDelete}
        }
    };
</script>
<style>

</style>